﻿#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

typedef struct Student_s
{
	char no[10];
	char name[11];
	int score;
}Student;

typedef struct TContext_s
{
	int n;
	Student v[10];
}TContext;

TContext context;

void read_data(TContext* ctx)
{
	scanf("%d", &ctx->n);
	for (int i = 0; i < ctx->n; ++i)
	{
		scanf("%s %s %d", ctx->v[i].no, ctx->v[i].name, &ctx->v[i].score);
	}
}


void do_task(TContext* ctx)
{
	float average = 0;
	for (int i = 0; i < ctx->n; ++i)
	{
		average += ctx->v[i].score;
	}
	average /= ctx->n;
	printf("%.2f\n", average);
	for (int i = 0; i < ctx->n; ++i)
	{
		if (average > ctx->v[i].score)
			printf("%s %s\n", ctx->v[i].name, ctx->v[i].no);
	}
}

void solve(TContext* ctx)
{
	read_data(ctx);
	do_task(ctx);
}

int main()
{
	freopen("D:/Develop/GitRepos/MOOC/浙江大学/数据结构/201906/DataStructure/M2019秋C入门和进阶练习集/7-106.txt", "r", stdin);
	solve(&context);
	return 0;
}
